home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / c / library / mslang / zstud1 / mainfrm.cp_ / MAINFRM.CPP
Encoding:
C/C++ Source or Header  |  1994-04-09  |  19.2 KB  |  444 lines

  1. // mainfrm.cpp : implementation of the CMainFrame class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "zdemo.h"
  6. #include <zip.h>
  7. #include "mainfrm.h"
  8. #include <direct.h>
  9. #include "czip.h"
  10. #include "unzip.h"
  11.  
  12. #ifdef _DEBUG
  13. #undef THIS_FILE
  14. static char BASED_CODE THIS_FILE[] = __FILE__;
  15. #endif
  16.  
  17.             ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  18.             // CMainFrame
  19.             
  20.             IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
  21.             
  22.             BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
  23.                 //{{AFX_MSG_MAP(CMainFrame)
  24.                 ON_WM_CREATE()
  25.                 ON_COMMAND(IDM_SELECT, OnSelect)
  26.                 ON_COMMAND(IDM_ZIP, OnZipCommand)
  27.                 ON_COMMAND(IDM_UNZIP, OnUnzipCommand)
  28.                 ON_MESSAGE( PM_ZIP, OnZip )
  29.                 ON_MESSAGE( PM_UNZIP, OnUnzip )
  30.                 ON_MESSAGE( PM_VIEW, OnView )
  31.                 ON_MESSAGE( ZN_FILEZIPPED, OnZnFileZipped )
  32.                 ON_MESSAGE( ZN_ZIPPING, OnZnZipping )
  33.                 ON_MESSAGE( ZN_WRITING, OnWriting )
  34.                 ON_MESSAGE( ZN_COMPUTE, OnCompute )
  35.                 ON_MESSAGE( ZN_OPENFILE, OnOpenFile )
  36.                 ON_MESSAGE( ZN_EXPANDING, OnExpanding )
  37.                 ON_MESSAGE( ZN_CLOSEFILE, OnCloseFile )
  38.                 //}}AFX_MSG_MAP
  39.             END_MESSAGE_MAP()
  40.             
  41.             /////////////////////////////////////////////////////////////////////////////
  42.             // arrays of IDs used to initialize control bars
  43.             
  44.             // toolbar buttons - IDs are command buttons
  45.             static UINT BASED_CODE buttons[] =
  46.             {
  47.                 // same order as in the bitmap 'toolbar.bmp'
  48.                 IDM_ZIP,
  49.                 IDM_UNZIP,
  50.             };
  51.             
  52.             static UINT BASED_CODE indicators[] =
  53.             {
  54.                 ID_SEPARATOR,           // status line indicator
  55.             };
  56.             
  57.             /////////////////////////////////////////////////////////////////////////////
  58.             // CMainFrame construction/destruction
  59.             
  60.             CMainFrame::CMainFrame()
  61.             {
  62.                 // TODO: add member initialization code here
  63.             }
  64.             
  65.             CMainFrame::~CMainFrame()
  66.             {
  67.             }
  68.             
  69.             
  70.                     // ---------------------------------------------------------------------------
  71.                     // PreCreate the frame
  72.                     // ---------------------------------------------------------------------------
  73.                     BOOL CMainFrame::PreCreateWindow( CREATESTRUCT& cs )
  74.                     {
  75.                     cs.cy = 280;    
  76.                     cs.cx = 500;                                                            
  77.                     cs.x = 80;
  78.                     cs.y = 80;
  79.                     cs.style = WS_VISIBLE | WS_MINIMIZEBOX | WS_POPUP | WS_BORDER | WS_CAPTION | WS_SYSMENU;
  80.                     return CFrameWnd::PreCreateWindow( cs );
  81.                     }
  82.                 
  83.             
  84.                     // ---------------------------------------------------------------------------
  85.                     // Create the frame
  86.                     // ---------------------------------------------------------------------------
  87.                     int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  88.                         {
  89.                         if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
  90.                             return -1;
  91.                         if (!m_wndToolBar.Create(this) ||
  92.                             !m_wndToolBar.LoadBitmap(IDR_MAINFRAME) ||
  93.                             !m_wndToolBar.SetButtons(buttons,
  94.                               sizeof(buttons)/sizeof(UINT)))
  95.                             {
  96.                             TRACE("Failed to create toolbar\n");
  97.                             return -1;      // fail to create
  98.                             }
  99.                         if (!m_wndStatusBar.Create(this) ||    !m_wndStatusBar.SetIndicators(indicators,
  100.                             sizeof(indicators)/sizeof(UINT)))
  101.                             {
  102.                             TRACE("Failed to create status bar\n");
  103.                             return -1;      // fail to create
  104.                             }
  105.                         return 0;
  106.                         }
  107.             
  108.             
  109.             /////////////////////////////////////////////////////////////////////////////
  110.             // CMainFrame diagnostics
  111.             
  112.             #ifdef _DEBUG
  113.             void CMainFrame::AssertValid() const
  114.             {
  115.                 CFrameWnd::AssertValid();
  116.             }
  117.             
  118.             void CMainFrame::Dump(CDumpContext& dc) const
  119.             {
  120.                 CFrameWnd::Dump(dc);
  121.             }
  122.             
  123.             #endif //_DEBUG
  124.             
  125.             /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  126.             // CMainFrame message handlers
  127.             
  128.             
  129.                 /////////////////////////////////////////////////////////////////
  130.                 //     WM_COMMAND ( IDM_SELECT )
  131.                 //    Select the ZIP file
  132.                 void CMainFrame::OnSelect()
  133.                     {
  134.                     // Show an open dialog box to let the user choose an existing zip file or to create it
  135.                         CString OldPath, NewPath, ActualPath;
  136.                     _getcwd( OldPath.GetBuffer( 160), 158 );                 
  137.                     OldPath.ReleaseBuffer();
  138.                     if ( CurrentZipFile != "" )          // get the zip path if exist
  139.                         ActualPath = GetPathFromFileName( CurrentZipFile );
  140.                     else
  141.                         ActualPath = "";    
  142.                     if ( ActualPath.GetLength() > 3 )    // delete the slash
  143.                         _chdir( ActualPath.Left(ActualPath.GetLength()-1) );
  144.                     else
  145.                         _chdir( ActualPath );
  146.                     CFileDialog FileDialogBox( TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_NOVALIDATE | OFN_PATHMUSTEXIST ,"Zip file (*.ZIP) |*.ZIP|All files (*.*)|*.*||" );
  147.                     if ( FileDialogBox.DoModal() == IDOK )
  148.                         {
  149.                         _getcwd( CurrentZipFile.GetBuffer( 180), 178 );                 
  150.                         CurrentZipFile.ReleaseBuffer();
  151.                         if ( CurrentZipFile.GetLength() > 3 )
  152.                             CurrentZipFile += "\\";
  153.                         CurrentZipFile += FileDialogBox.GetPathName();
  154.                         }
  155.                     if ( OldPath.GetLength() > 4 )
  156.                         OldPath = OldPath.Left( OldPath.GetLength()-1);
  157.                     GetActiveView()->SetDlgItemText(IDC_FILE, CurrentZipFile );
  158.                     GetActiveView()->SetDlgItemText(IDC_TEXT, "" );
  159.                     GetActiveView()->SetDlgItemText(IDC_OPERATION, "" );
  160.                     _chdir( OldPath );
  161.                 }
  162.             
  163.                     
  164.                     
  165.                 /////////////////////////////////////////////////////////////////
  166.                 //     WM_COMMAND ( IDM_ZIP )
  167.                 //    Call ZIP
  168.                 void CMainFrame::OnZipCommand()
  169.                     {
  170.                     // Call the CCZip dialog box to perform the zip process
  171.                     CCzip ZipDialogBox(this);
  172.                     ZipDialogBox.DoModal();
  173.                     }
  174.                     
  175.                     
  176.                 /////////////////////////////////////////////////////////////////
  177.                 //     WM_COMMAND ( IDM_UNZIP )
  178.                 //    Call UNZIP
  179.                 void CMainFrame::OnUnzipCommand()
  180.                     {
  181.                     // Call the CUnZip dialog box to perform the unzip process
  182.                     CUnZip UnzipDialogBox(this);
  183.                     UnzipDialogBox.DoModal();
  184.                     }
  185.             
  186.             
  187.                
  188.                
  189.             ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  190.             // Private messages to pilote the process
  191.             
  192.             
  193.                 /////////////////////////////////////////////////////////////////////////////////
  194.                 //    Start the Zip process ( PM_ZIP )
  195.                 afx_msg LRESULT CMainFrame::OnZip( WPARAM wParam, LPARAM lParam )
  196.                     {
  197.                     int Result;
  198.                     Result =  AddFileToZip( CurrentZipFile, sMask, iOverwrite, bPath,bRecurse,m_hWnd );    
  199.                     // Depending on the result, we set the text in the main window
  200.                     switch ( Result )        // I have some troubles regarding constants with my compiler...
  201.                         {                             
  202.                         case 1:    // warning ( ZERROR_WARNING )
  203.                                     GetActiveView()->SetDlgItemText( IDC_OPERATION, "Done ( but warnings )" );
  204.                                     GetActiveView()->SetDlgItemText( IDC_TEXT, "ok but warnings" );
  205.                         case 2:    // file error ( ZERROR_DESTFILE )
  206.                                     GetActiveView()->SetDlgItemText( IDC_OPERATION, "File error" );
  207.                                     GetActiveView()->SetDlgItemText( IDC_TEXT, "Source file or ZIP file\nmaybe dammaged!" );
  208.                         case 3:    // internal error ( ZERROR_INTERNAL )
  209.                                     GetActiveView()->SetDlgItemText( IDC_OPERATION, "Internal error" );
  210.                                     GetActiveView()->SetDlgItemText( IDC_TEXT, "Internal error.\nMaybe Zip file not generated!" );
  211.                         case 4:    // file error ( ZERROR_FORMAT )
  212.                                     GetActiveView()->SetDlgItemText( IDC_OPERATION, "Not a zip file" );
  213.                                     GetActiveView()->SetDlgItemText( IDC_TEXT, "Not a zip file.\nMaybe zip file corrupted!" );
  214.                         case 5:    // file error ( ZERROR_NOMEM )
  215.                                     GetActiveView()->SetDlgItemText( IDC_OPERATION, "Not enough memory" );
  216.                                     GetActiveView()->SetDlgItemText( IDC_TEXT, "Not enough memory to zip!\nSerious error!\nPlease use a smaller ZIP file!" );
  217.                         case 6:    // file error ( ZERROR_NOFILE )
  218.                                     GetActiveView()->SetDlgItemText( IDC_OPERATION, "No file or nothing to do!" );
  219.                                     GetActiveView()->SetDlgItemText( IDC_TEXT, "No file or nothing to do!" );
  220.                         case 7:    // file error ( ZERROR_NODLL )
  221.                                     GetActiveView()->SetDlgItemText( IDC_OPERATION, "Can' t find ZDLL12B.DLL" );
  222.                                     GetActiveView()->SetDlgItemText( IDC_TEXT, "Please put ZDLL12B.DLL in your current directory.\nMaybe this DLL is corrupted." );
  223.                         default:// ok ( ZERROR_OK )
  224.                                     GetActiveView()->SetDlgItemText( IDC_OPERATION, "Done" );
  225.                                     GetActiveView()->SetDlgItemText( IDC_TEXT, "ok" );
  226.                         }
  227.                     m_wndStatusBar.SetWindowText( "Ready" );    
  228.                     return 0L;
  229.                     }
  230.             
  231.             
  232.             
  233.             
  234.                 
  235.                 /////////////////////////////////////////////////////////////////////////////////
  236.                 //    Start the Unzip process (PM_UNZIP )
  237.                 afx_msg LRESULT CMainFrame::OnUnzip( WPARAM wParam, LPARAM lParam )
  238.                    {
  239.                    int Result;    
  240.                    SetReceivingWindow( m_hWnd );    // to receive all notification messages during unzipping
  241.                    SetBackgroundMode( TRUE );            // to activate the multitask mode
  242.                    Result = ExtractZipFiles( CurrentZipFile, sMask, "" /* DestDir is always WINDOWS/TEST */, iOverwrite, bPath );
  243.                     // Depending on the result, we set the text in the main window
  244.                     switch ( Result )        // I have some troubles regarding constants with my compiler...
  245.                         {                             
  246.                         case 1:    // internal error ( ZEXTRACT_INTERNALERROR )
  247.                                     GetActiveView()->SetDlgItemText( IDC_OPERATION, "Internal error" );
  248.                                     GetActiveView()->SetDlgItemText( IDC_TEXT, "Internal error.\nMaybe files not created!" );
  249.                         case 2:    // file not found ( ZEXTRACT_FILENOTFOUND )
  250.                                     GetActiveView()->SetDlgItemText( IDC_OPERATION, "File not found" );
  251.                                     GetActiveView()->SetDlgItemText( IDC_TEXT, "Source file missing.\nPlease choose existing files to unzip!" );
  252.                         case 3:    // bad format ( ZEXTRACT_CORRUPTED )
  253.                                     GetActiveView()->SetDlgItemText( IDC_OPERATION, "Zip file format error" );
  254.                                     GetActiveView()->SetDlgItemText( IDC_TEXT, "Zip file format error.\nMaybe Zip file is dammaged!" );
  255.                         case 4:    // no file ( ZEXTRACT_EMPTY )
  256.                                     GetActiveView()->SetDlgItemText( IDC_OPERATION, "Nothing to do!" );
  257.                                     GetActiveView()->SetDlgItemText( IDC_TEXT, "Nothing to do: no files!" );
  258.                         case 5:    // fatal error ( ZEXTRACT_ERRORINZIPFILE )
  259.                                     GetActiveView()->SetDlgItemText( IDC_OPERATION, "Fatal error" );
  260.                                     GetActiveView()->SetDlgItemText( IDC_TEXT, "Fatal error!\nMaybe zip file is corrupted!" );
  261.                         default:// ok ( ZERROR_OK )
  262.                                     GetActiveView()->SetDlgItemText( IDC_OPERATION, "Unzipping is done" );
  263.                                     GetActiveView()->SetDlgItemText( IDC_TEXT, "ok" );
  264.                         }
  265.                     m_wndStatusBar.SetWindowText( "Ready" );    
  266.                     return 0L;
  267.                     }        
  268.                    
  269.                    
  270.                    
  271.                    /////////////////////////////////////////////////////////////////////////////////
  272.                 //    Start the View process ( PM_VIEW )
  273.                 afx_msg LRESULT CMainFrame::OnView( WPARAM wParam, LPARAM lParam )
  274.                    {
  275.                    SetReceivingWindow( m_hWnd );    // to receive all notification messages during unzipping
  276.                    SetBackgroundMode( TRUE );            // to activate the multitask mode
  277.                    if ( !ViewFileFromZip( CurrentZipFile, sMask, FALSE ))    // view one or several files in a Zip
  278.                         MessageBox( "Maybe not all files can be viewed...", "Zip Studio", MB_OK | MB_ICONEXCLAMATION );
  279.                     m_wndStatusBar.SetWindowText( "Ready" );    
  280.                     return 0L;
  281.                     }    
  282.                     
  283.                         
  284.                 
  285.             /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  286.             // Notifications messages treatment ( ZN_... )
  287.             
  288.             
  289.                 
  290.                 /////////////////////////////////////////////////////////////////////////////////
  291.                 //    A file is completly zipped ( ZN_FILEZIPPED ) [ZIP]
  292.                 afx_msg LRESULT CMainFrame::OnZnFileZipped( WPARAM wParam, LPARAM lParam )
  293.                     {
  294.                     CString csOperation, csStatus, csDetail;
  295.                     wsprintf( csStatus.GetBuffer(200), "The file %s is zipped!", (LPSTR)lParam );
  296.                     csStatus.ReleaseBuffer();
  297.                     wsprintf( csOperation.GetBuffer(200), "%s zipped!", (LPSTR)lParam );
  298.                     csOperation.ReleaseBuffer();
  299.                     wsprintf( csDetail.GetBuffer(300), "%s is cuccessfully added to\n%s.\nCompression rate is %i %%.", 
  300.                         (LPSTR)lParam, CurrentZipFile, (int)wParam );
  301.                     csDetail.ReleaseBuffer();
  302.                     GetActiveView()->SetDlgItemText( IDC_OPERATION, csOperation );
  303.                     GetActiveView()->SetDlgItemText( IDC_TEXT, csDetail );
  304.                     m_wndStatusBar.SetWindowText( csStatus );    
  305.                     return 0L;
  306.                     }                                                                      
  307.                 
  308.                 
  309.                 /////////////////////////////////////////////////////////////////////////////////
  310.                 //    A file is processing ( ZN_ZIPPING ) [ZIP]
  311.                 afx_msg LRESULT CMainFrame::OnZnZipping( WPARAM wParam, LPARAM lParam )
  312.                     {
  313.                     CString csOperation, csStatus;
  314.                     wsprintf ( csStatus.GetBuffer(180), "Compressed size: %i Ko.", (int)wParam );
  315.                     csStatus.ReleaseBuffer();
  316.                     GetActiveView()->SetDlgItemText( IDC_OPERATION, csStatus );
  317.                     if ( wParam < 4 )    // at the beginning...
  318.                         {
  319.                         wsprintf ( csOperation.GetBuffer(180), "%s in process!", (LPSTR)lParam );
  320.                         csOperation.ReleaseBuffer();
  321.                         GetActiveView()->SetDlgItemText( IDC_TEXT, csOperation );
  322.                         m_wndStatusBar.SetWindowText( csOperation );    
  323.                         }
  324.                     return 0L;
  325.                     }                                                                      
  326.                     
  327.                 
  328.                 
  329.                 /////////////////////////////////////////////////////////////////////////////////
  330.                 //    The zip file is complete ( ZN_WRITING ) [ZIP]
  331.                 afx_msg LRESULT CMainFrame::OnWriting( WPARAM wParam, LPARAM lParam )
  332.                     {
  333.                     CString csOperation, csStatus;
  334.                     wsprintf( csStatus.GetBuffer(200), "%s successfully zipped! Please wait...", (LPSTR)lParam );
  335.                     csStatus.ReleaseBuffer();
  336.                     wsprintf( csOperation.GetBuffer(180), "%s zipped!", (LPSTR)lParam );
  337.                     csOperation.ReleaseBuffer();
  338.                     GetActiveView()->SetDlgItemText( IDC_OPERATION, csOperation );
  339.                     GetActiveView()->SetDlgItemText( IDC_TEXT, csOperation );
  340.                     m_wndStatusBar.SetWindowText( csStatus );    
  341.                     return 0L;
  342.                     }                                                                      
  343.                     
  344.                 
  345.                 
  346.                 /////////////////////////////////////////////////////////////////////////////////
  347.                 //    A file is processing ( ZN_COMPUTE ) [ZIP]
  348.                 afx_msg LRESULT CMainFrame::OnCompute( WPARAM wParam, LPARAM lParam )
  349.                     {
  350.                     CString csStatus, CTotal;
  351.                     _itoa( (unsigned)wParam, CTotal.GetBuffer(10), 10 );
  352.                     CTotal.ReleaseBuffer();
  353.                     wsprintf( csStatus.GetBuffer(200), "%s contains " , CurrentZipFile );    // bug?? with %i and (int)wParam
  354.                     csStatus.ReleaseBuffer();                                                                     
  355.                     csStatus += CTotal;                                           
  356.                     csStatus += " files.";
  357.                     MessageBox( csStatus );
  358.                     GetActiveView()->SetDlgItemText( IDC_OPERATION, csStatus );
  359.                     GetActiveView()->SetDlgItemText( IDC_TEXT, csStatus );
  360.                     m_wndStatusBar.SetWindowText( csStatus );    
  361.                     // add a message box if treatment require a long time ( to prevent the user to reboot !!! )
  362.                     if ( wParam > 500 )
  363.                         {
  364.                         if ( wParam > 1000 )
  365.                             MessageBox( "There are many files in this Zip file.\nComputing this file will require few minutes.", "Zip Studio", MB_OK | MB_ICONEXCLAMATION );
  366.                         else
  367.                             MessageBox( "There are many files in this Zip file.\nComputing this file will require few seconds.", "Zip Studio", MB_OK );
  368.                         }                                                                                                                                            
  369.                     return 0L;
  370.                     }                                                                      
  371.                 
  372.                 
  373.                 /////////////////////////////////////////////////////////////////////////////////
  374.                 //    A file is opened for unzip ( ZN_OPENFILE ) [UNZIP]
  375.                 afx_msg LRESULT  CMainFrame::OnOpenFile( WPARAM wParam, LPARAM lParam )
  376.                     {
  377.                     CString csStatus, csDetail, csMessage;
  378.                     if ( !wParam )
  379.                         {
  380.                         wsprintf( csMessage.GetBuffer(200), "Can' t open %s!", (LPSTR)lParam );
  381.                         csMessage.ReleaseBuffer();
  382.                         MessageBox( csMessage,  "Zip Studio", MB_OK | MB_ICONSTOP );
  383.                         GetActiveView()->SetDlgItemText( IDC_OPERATION, "Fatal error!" );
  384.                         GetActiveView()->SetDlgItemText( IDC_TEXT, "Fatal error!" );
  385.                         m_wndStatusBar.SetWindowText( "Fatal error!" );    
  386.                         return 0L;
  387.                         }
  388.                     wsprintf( csStatus.GetBuffer(200), "%s successfully opened.", (LPSTR)lParam );
  389.                     csStatus.ReleaseBuffer();
  390.                     wsprintf( csDetail.GetBuffer(300), "%s from %s\nis opened.", (LPSTR)lParam, CurrentZipFile );
  391.                     csDetail.ReleaseBuffer();
  392.                     GetActiveView()->SetDlgItemText( IDC_OPERATION, csStatus );
  393.                     GetActiveView()->SetDlgItemText( IDC_TEXT, csDetail );
  394.                     m_wndStatusBar.SetWindowText( csStatus );    
  395.                     return 0L;
  396.                     }                                                                      
  397.                 
  398.                 
  399.                     
  400.                 /////////////////////////////////////////////////////////////////////////////////
  401.                 //    A file is in process ( ZN_EXPANDING ) [UNZIP]
  402.                 afx_msg LRESULT  CMainFrame::OnExpanding( WPARAM wParam, LPARAM lParam )
  403.                     {
  404.                     CString csStatus, csDetail;
  405.                     wsprintf( csStatus.GetBuffer(200), "%s is in process.- %i %% filled.", (LPSTR)lParam, (int)wParam );
  406.                     csStatus.ReleaseBuffer();
  407.                     GetActiveView()->SetDlgItemText( IDC_OPERATION, csStatus );
  408.                     if ( wParam < 4 ) // at the beginning
  409.                         {
  410.                         wsprintf( csDetail.GetBuffer(300), "%s from %s\nis unzipping...", (LPSTR)lParam, CurrentZipFile );
  411.                         csDetail.ReleaseBuffer();
  412.                         GetActiveView()->SetDlgItemText( IDC_TEXT, csDetail );
  413.                         m_wndStatusBar.SetWindowText( "Unzipping..." );    
  414.                         }
  415.                     return 0L;
  416.                     }                                                                      
  417.                                                                                                           
  418.                                                                                                       
  419.             
  420.                 /////////////////////////////////////////////////////////////////////////////////
  421.                 //    A file is unzipped ( ZN_CLOSEFILE ) [UNZIP]
  422.                 afx_msg LRESULT  CMainFrame::OnCloseFile( WPARAM wParam, LPARAM lParam )
  423.                     {
  424.                     CString csOperation, csStatus, csDetail, csMessage;
  425.                     if ( !wParam )
  426.                         {
  427.                         wsprintf( csMessage.GetBuffer(200), "Can' t unzip %s!", (LPSTR)lParam );
  428.                         csMessage.ReleaseBuffer();
  429.                         MessageBox( csMessage, "Zip Studio", MB_OK | MB_ICONSTOP );
  430.                         GetActiveView()->SetDlgItemText( IDC_OPERATION, "Fatal error!" );
  431.                         GetActiveView()->SetDlgItemText( IDC_TEXT, "Fatal error!" );
  432.                         m_wndStatusBar.SetWindowText( "Fatal error!" );    
  433.                         return 0L;
  434.                         }
  435.                     wsprintf( csStatus.GetBuffer(200), "%s is successfully unzipped.", (LPSTR)lParam );
  436.                     csStatus.ReleaseBuffer();
  437.                     wsprintf( csDetail.GetBuffer(300), "%s from %s\nis successfully unzipped.", (LPSTR)lParam, CurrentZipFile );
  438.                     csDetail.ReleaseBuffer();
  439.                     GetActiveView()->SetDlgItemText( IDC_OPERATION, csStatus );
  440.                     GetActiveView()->SetDlgItemText( IDC_TEXT, csDetail );
  441.                     m_wndStatusBar.SetWindowText( csStatus );    
  442.                     return 0L;
  443.                     }                                                                      
  444.